package com.zonski.jbots.wireless.client;

import com.zonski.jbots.engine.Entity;
import com.zonski.jbots.engine.Rectangle;

import javax.microedition.lcdui.Graphics;

/**
 * Created by IntelliJ IDEA.
 * User: Chris Glover
 * Date: Nov 3, 2003
 * Time: 11:41:05 AM
 * To change this template use Options | File Templates.
 */
public class BoundsEntityRenderer implements EntityRenderer
{
    public static final BoundsEntityRenderer INSTANCE = new BoundsEntityRenderer(255, 128, 0);

    private int red;
    private int green;
    private int blue;

    public BoundsEntityRenderer(int red, int green, int blue)
    {
        this.red = red;
        this.green = green;
        this.blue = blue;
    }

    public void render(Graphics g, Entity entity)
    {
        Rectangle bounds = entity.bounds;
        g.setColor(this.red, this.green, this.blue);
        g.drawRect(bounds.x, bounds.y, bounds.width-1, bounds.height-1);
    }
}
